<template>
  <el-dialog :title="title" :visible.sync="dialogFormVisible" width="500px" @close="close" :close-on-click-modal="closeModel">
    <el-form :model="form" label-width="100px" :rules="rules" ref="ruleForm">
      <el-form-item label="淘宝账号" prop="name"><el-input v-model="form.name" autocomplete="off"></el-input></el-form-item>
      <!--el-form-item label="PID" prop="pid"><el-input v-model="form.pid" autocomplete="off"></el-input></el-form-item>
      <el-form-item label="AppKey" prop="appkey"><el-input v-model="form.appkey" autocomplete="off"></el-input></el-form-item>
      <el-form-item label="AppSecret" prop="appsecret"><el-input v-model="form.appsecret" autocomplete="off"></el-input></el-form-item-->
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="close">取 消</el-button>
      <el-button type="primary" @click="save">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: 'TableEdit',
  data() {
    return {
      form: {
        name: '',
      },
      title: '',
      dialogFormVisible: false,
      rules: {
        name: [{ required: true, message: '请输入淘宝账号', trigger: 'blur' }]
      },
      closeModel:false
    };
  },
  created() {},
  methods: {
    showEdit(row) {
      this.title = '增加新淘宝账号';
      this.dialogFormVisible = true;
    },
    close() {
      this.form = this.$options.data().form;
      this.dialogFormVisible = false;
    },
    save() {
      this.$refs['ruleForm'].validate(valid => {
        if (valid) {
          let setdata = this.form
          this.$emit("msgEvent",setdata)
          return false;
        } else {
          return false;
        }
      });
    }
  }
};
</script>
<style lang="scss" scoped></style>
